package com.wecloud.core.data.jnlservice;

import java.util.Map;

import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;

import com.wecloud.core.data.jnl.JnlService;
import com.wecloud.core.exception.WeException;
/**
 * 保存操作日志信息
 * @author qq374
 *
 */
public class ConsoleLogJnlService extends JnlService{
	public void SaveConsoleLogInfo(Map map){
		getTransactionTemplate().execute(new TransactionCallback() {
			@Override
			public Object doInTransaction(TransactionStatus status) {
				try{
					insert("console.saveLog", map);
				}catch (Exception  e) {
					getAnnotationDrivenTransactionManager().rollback(status);
					throw new  WeException(e);
				}
				return null;
			}
		});
	}
	public void UpdateConsoleLogInfo(Map map){
		getTransactionTemplate().execute(new TransactionCallback() {
			@Override
			public Object doInTransaction(TransactionStatus status) {
				try{
					update("console.updateLog", map);
				}catch (Exception  e) {
					getAnnotationDrivenTransactionManager().rollback(status);
					throw new  WeException(e);
				}
				return null;
			}
		});
	}
}
